import java.util.ArrayList;
import java.util.Collections;

public class h_6 {
    public static void main(String[] args) {
        int arr1[]=new int[]{1,2,3};
        int arr2[]=new int[]{3,4,5,2};

        ArrayList<Integer> list=new ArrayList<>();
        for(int i=0;i<arr1.length;i++){
            if(!list.contains(arr1[i])){
                list.add(arr1[i]);
            }
        }
        for(int i=0;i<arr2.length;i++){
            if(!list.contains(arr2[i])){
                list.add(arr2[i]);
            }
        }
        System.out.println(list.toString());
    }
}
